package cn.mason.echarts.service;

import cn.mason.echarts.dao.UserDao;
import cn.mason.echarts.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author Mason
 * @date 2018/6/7
 */
@Service("UserService")
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao userDao;
    @Override
    public List<User> listByParams(Map<String, Object> params) {
        return userDao.listByParams(params);
    }

    @Override
    public int insert(User record) {
        return userDao.insert(record);
    }

    @Override
    public List<User> listAll() {
        return userDao.listAll();
    }

    @Override
    public int delete(String id) {
        return userDao.deleteByPrimaryKey(id);
    }

    @Override
    public User findByAccount(String account) {
        return userDao.findByAccount(account);
    }

    @Override
    public User selectByPrimaryKey(String id){ return userDao.selectByPrimaryKey(id);}

    @Override
    public int updateByPrimaryKey(User user){return userDao.updateByPrimaryKey(user);}
}
